package com.bootdo.system.service.impl;

import com.bootdo.system.dao.ZichanhistoryDao;
import com.bootdo.system.domain.ZichanhistoryDO;
import com.bootdo.system.service.ZichanhistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class ZichanhistoryServiceImpl implements ZichanhistoryService {
	@Autowired
	private ZichanhistoryDao zichanhistoryDao;
	
	@Override
	public ZichanhistoryDO get(Long id){
		return zichanhistoryDao.get(id);
	}
	
	@Override
	public List<ZichanhistoryDO> list(Map<String, Object> map){
		return zichanhistoryDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return zichanhistoryDao.count(map);
	}
	
	@Override
	public int save(ZichanhistoryDO zichanhistory){
		return zichanhistoryDao.save(zichanhistory);
	}
	
	@Override
	public int update(ZichanhistoryDO zichanhistory){
		return zichanhistoryDao.update(zichanhistory);
	}
	
	@Override
	public int remove(Long id){
		return zichanhistoryDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return zichanhistoryDao.batchRemove(ids);
	}

    @Override
    public List<ZichanhistoryDO> getUserZichanHistory(Long userId,String jiaoyitype) {
		if("0".equals(jiaoyitype)){
			return zichanhistoryDao.getUserZichanHistory1(userId);
		}else{
			return zichanhistoryDao.getUserZichanHistory2(userId, jiaoyitype);
		}


    }

    @Override
    public ZichanhistoryDO getByBeizhu(String txHash) {

		return zichanhistoryDao.getByBeizhu(txHash);
    }

}
